import asyncio
import aiohttp
import random

def get_random():
    return random.randint(0,50)

async def test(args):
    randnum = get_random()
    while len(args)>0:
        print('%s ：%s'%(args.pop(),randnum))
        await asyncio.sleep(0.2)
        pass

loop = asyncio.get_event_loop()
work_list = [i for i in range(99)]
tasks = [asyncio.ensure_future(test(work_list)) for i in range(5)]
loop.run_until_complete(asyncio.wait(tasks))
print('over')
